package com.hotel.project.usercenter.controller;

import com.hotel.project.usercenter.domain.Integration;
import com.hotel.project.usercenter.service.IntegrationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author William
 * @create 2022-04-13 23:34
 */
@RestController
@RequestMapping("/integration")
public class IntegrationController {

    @Autowired
    private IntegrationService integrationService;

    @ApiOperation(value = "查询", notes = "通过用户id查询积分")
    @GetMapping("select-integration-by-userid/{id}")
    public List<Integration> selectIntegrationByUserId(@PathVariable("id") Long userId){
        return integrationService.findByUserId(userId);
    }
}
